//@ts-nocheck
// eslint-disable-next-line @typescript-eslint/no-var-requires
const express = require('express');
const app = express();
app.use(function (req, res, next) {
  res.header('Access-Control-Allow-Origin', 'http://localhost:3000');
  next();
});
app.get('/api/users', function (req, res) {
  const offset = parseInt(req.query.offset);
  const limit = parseInt(req.query.limit);
  const result = [];
  for (let i = offset; i < offset + limit; i++) {
    result.push({ id: i + 1, name: 'name' + (i + 1) });
  }
  res.json(result);
});
app.listen(8000);
